class Solution {
public:
    int secondHighest(string s) {
        int max1=-1,max2=-1;
        for(auto ch :s)
        {
            if(isdigit(ch))
            {
                int num=ch-'0';
                if(num>max1)
                {
                    max2=max1;
                    max1=num;
                }
                else if(num<max1 && num>max2)
                {
                    max2=num;
                }
            }
        }
        return max2;
    }
};